import request from '@/utils/request'

// 创建入库单
export function createEntryOrder(data) {
  return request({
    url: '/hs/entry-order/create',
    method: 'post',
    data: data
  })
}

// 创建三方入库单
export function createTripartiteEntryOrder(data) {
  return request({
    url: '/hs/entry-order/tripartite-create',
    method: 'post',
    data: data
  })
}

// 更新入库单
export function updateEntryOrder(data) {
  return request({
    url: '/hs/entry-order/update',
    method: 'put',
    data: data
  })
}

// 删除入库单
export function deleteEntryOrder(id) {
  return request({
    url: '/hs/entry-order/delete?id=' + id,
    method: 'delete'
  })
}

// 获得入库单
export function getEntryOrder(id) {
  return request({
    url: '/hs/entry-order/get?id=' + id,
    method: 'get'
  })
}

// 获得入库单分页
export function getEntryOrderPage(params) {
  return request({
    url: '/hs/entry-order/page',
    method: 'get',
    params
  })
}

// 导出入库单 Excel
export function exportEntryOrderExcel(params) {
  return request({
    url: '/hs/entry-order/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
